import { defHttp } from '@/utils/http/axios'

enum Api {
  ENERGY_LIBRARY_TABLE_LIST = '/energy/efficiency/pageLibrary',
  ADD_ENERGY_LIBRARY_RECORD = '/energy/efficiency/addLibrary',
  UPDATE_ENERGY_LIBRARY_RECORD = '/energy/efficiency/modifyLibrary',
  DELETE_ENERGY_LIBRARY_RECORD = '/energy/efficiency/removeLibrary',
  // 获取指标名称
  GET_LABEL_NAME_LIST = '/main/data/type/all',
}

export const getEnergyLibraryTableList = (params) =>
  defHttp.get({ url: Api.ENERGY_LIBRARY_TABLE_LIST, params })
export const addEnergyLibraryRecord = (params) =>
  defHttp.post({ url: Api.ADD_ENERGY_LIBRARY_RECORD, params })
export const updateEnergyLibraryRecord = (params) =>
  defHttp.post({ url: Api.UPDATE_ENERGY_LIBRARY_RECORD, params })
export const deleteEnergyLibraryRecord = (params) =>
  defHttp.post({ url: Api.DELETE_ENERGY_LIBRARY_RECORD, params })
export const getLabelList = () =>
  defHttp.get({ url: Api.GET_LABEL_NAME_LIST })
